package com.basker.pisces.core.query.factory;

import org.springframework.util.Assert;

import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

@Getter
@Setter
@ToString
public class Order {
    /**
     * 排序字段
     */
    private String field;

    /**
     * 是否降序，默认false
     */
    private boolean desc = false;

    public Order() {

    }

    public Order(String field, boolean desc) {
        Assert.hasLength(field, "parameter 'field' is required");

        this.field = field;
        this.desc = desc;
    }
}